// GotW.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "GotW01.h"
#include "GotW02.h"


void GotW01();
void GotW02();

int _tmain(int argc, _TCHAR* argv[])
{
	GotW01();
	GotW02();

	return 0;
}

void GotW01()
{
	using namespace CodeMood;
	Widget wa;						// (a)

	Widget wb();					// (b)
//	Widget wc{};					// (c)

	Widget wd(wa);					// (d)
//	Widget we{xa};					// (e)

	Widget wf = wa;					// (f)
//	Widget wg = {xa};				// (g)

	auto wh = wa;					// (h)
//	auto wi = Widget{xa};			// (i)
}

void GotW02()
{
	using namespace CodeMood;
	{
		vector<Employee> emps;
		emps.reserve(EMPS);
		for (int i = 0; i < EMPS; ++i) {
			stringstream ssname, ssaddr;
			ssname << "name" << i;
			ssaddr << "addr" << i;
			emps.push_back(Employee(ssname.str(), ssaddr.str()));
		}
		//srand(0);
		//random_shuffle(begin(emps), end(emps));

		TIME(test_average(emps, find_addr_01));
		TIME(test_average(emps, find_addr_02));
		TIME(test_average(emps, find_addr_03));
		TIME(test_average(emps, find_addr_04));
		TIME(test_average(emps, find_addr_05));
		TIME(test_average(emps, find_addr_06));
	}

	cout << Employee::count_ << endl;
}